import type { Organization } from './organization'

// 任务状态枚举
export enum SubmissionStatus {
  PENDING = 'PENDING',
  TEACHER_REVIEWING = 'TEACHER_REVIEWING', // 教师审核中
  APPROVED = 'APPROVED',
  REJECTED = 'REJECTED'
}

// 任务信息
export interface TaskVO {
  id: number
  name: string
  description?: string
  deadline: string
  fileRequirements?: string
  submitRequirements?: string
  createTime: string
  updateTime: string
  classes: Organization[]
}

// 教师负责的班级信息
export interface TeacherClassVO {
  id: number
  name: string
  majorId: number
  majorName: string
  collegeId: number
  collegeName: string
}

// 任务统计信息
export interface TaskStatisticsVO {
  totalCount: number
  submittedCount: number
  unsubmittedCount: number
  submissionRate: string
}

// 创建/更新任务参数
export interface TaskDTO {
  id?: number
  name: string
  description?: string
  deadline: string
  fileRequirements?: string
  submitRequirements?: string
  classId: number
}

// 查询参数
export interface TaskQueryParams {
  name?: string
  classIds?: number[]
  startTime?: string
  endTime?: string
  page?: number
  size?: number
  sort?: string
}

// 任务截止状态枚举
export enum TaskDeadlineStatus {
  NOT_STARTED = 'NOT_STARTED', // 未开始
  IN_PROGRESS = 'IN_PROGRESS', // 进行中
  EXPIRED = 'EXPIRED'          // 已过期
}

// 学生任务查询参数
export interface StudentTaskQueryParams {
  name?: string
  submitted?: boolean 
  status?: TaskDeadlineStatus
  startTime?: string
  endTime?: string
  page?: number
  size?: number
  sort?: string
}

// 学生任务信息
export interface StudentTaskVO extends TaskVO {
  submitted: boolean
  submissionId?: number
  submissionStatus?: SubmissionStatus
  submissionTime?: string
  files: { name: string; url: string; fileUrl?: string }[];
  comment?: string
  reviewComment?: string
  avatar?: string
  submissionComment?: string
  submitStatus?: TaskSubmitStatus
}

// 任务提交参数
export interface TaskSubmissionDTO {
  taskId: number
  files: {
    fileName: string;
    fileUrl: string;
    fileSize: number;
    fileType: string;
  }[];
  comment?: string
}

export interface TaskSubmissionVO {
  id: number;
  taskId: number;
  taskName: string;
  files: Array<{
    fileName: string;
    fileUrl: string;
    fileSize: number;
    fileType: string;
  }>;
  comment?: string;
  // ... other properties
}

// 添加任务提交状态枚举
export enum TaskSubmitStatus {
  EXPIRED = 'EXPIRED',      // 已截止
  PENDING = 'PENDING',      // 待提交
  REVIEWING = 'REVIEWING',  // 待审核
  APPROVED = 'APPROVED',    // 审核通过
  REJECTED = 'REJECTED'     // 审核驳回
}